clear
set more off

* Survey data
insheet using OrigData/profile_extract.csv, clear
save Data/survey_raw_130213, replace

insheet using OrigData/profile_extract_220313.csv, clear
save Data/survey_raw_220313, replace

insheet using OrigData/profile_extract_060313.csv, clear
save Data/survey_raw_060313, replace

insheet using OrigData/profile_extract_160513.csv, clear
save Data/survey_raw_160513, replace

insheet using OrigData/profile_extract_240913.csv, clear
save Data/survey_raw_240913, replace

* Data for customers offered Billcap
insheet using OrigData/Billcap_Client1_Customers_Feb_14_2013.csv, clear
save Data/customer_info_raw, replace

* Interval data for all customers
** need to creat interval_data_no_quotes using the following at a command line: sed 's/"//g' interval_data.csv > interval_data_no_quotes.csv

insheet using OrigData/interval_data_no_quotes_040613.csv, comma clear



rename intervals interval1
*rename v# interval#, renumber(2)
**** note for interval_data_no_quotes_040613.csv start loop with 7, previous start with 5
renpfix v interval
forval i=7(1)103 {
local x = `i'-5
rename interval`i' interval`x'
}

drop interval49-interval98
save Data/energy_use_intervals_raw_040613, replace


insheet using OrigData/interval_data_no_quotes_220313.csv, comma clear


rename intervals interval1
renpfix v interval
forval i=5(1)101 {
local x = `i'-3
rename interval`i' interval`x'
}

drop interval49-interval98
save Data/energy_use_intervals_raw_220313, replace


insheet using OrigData/interval_data_no_quotes.csv, comma clear

rename intervals interval1

renpfix v interval
forval i=5(1)101 {
local x = `i'-3
rename interval`i' interval`x'
}

drop interval49-interval98
save Data/energy_use_intervals_raw_130213, replace

* Location and price data
insheet using OrigData/VIC_cust_file_anonymised_20130125.csv, clear
save Data/location_raw, replace

* Heating and cooling degree days
insheet using OrigData/climatezone_postcode.csv, clear
drop v*
save Data/climate_postcode_raw, replace

insheet using OrigData/climatezone_hdd_cdd.csv, clear
drop v*
save Data/heating_cooling_raw, replace


